package com.iu.eblood.spring.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppContextImpl implements SpringContext  {

	private static AppContextImpl appContext;
	
	private AppContextImpl()
	{
		
	}
	
	public Object getBean(String beanName) {
		ApplicationContext context=new ClassPathXmlApplicationContext("appContext.xml");
		return context.getBean(beanName);
	}
	
	
	public static AppContextImpl getContext()
	{
		if (appContext==null) {
			appContext=new AppContextImpl();
		}
		
		return appContext;	
	}

	public ApplicationContext getRealContext() {
		return new ClassPathXmlApplicationContext("appContext.xml");
	}

	

}
